import { DailyAwardList } from "./DailyAwardList";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { Language } from "../../../../../extend/language/Language";
import { GTileList } from "../../../../../com/mui/controls/GTileList";
import { ScrollPolicy } from "../../../../../fl/controls/ScrollPolicy";
import { DailyItemRenderer } from "./DailyItemRenderer";
import { PageTool } from "../../../../common/global/PageTool";
import { PageSelecter } from "../../common/pageSelect/PageSelecter";
import { DailyInfo } from "../../../model/DailyInfo";
import { LoaderManager } from "../../../../../com/gengine/resource/LoaderManager";
import { SWFInfo } from "../../../../../com/gengine/resource/info/SWFInfo";
type int = number;
//class BossAwardList
    
    export  class BossAwardList extends DailyAwardList
    {
        constructor(arg1: int, arg2: int)
        {
            super(arg1, arg2);
            this.mouseEnabled = false;
            return;
        }

        protected /* override */ initUI(): void
        {
            super.initUI();
            return;
        }

        protected /* override */ createDailyInfo(): void
        {
            var loc2=null;
            var loc3=null;
            var loc4=null;
            super.createDailyInfo();
            var loc1=GlobalClass.getBitmap(ImagesConst.RechargeSmallBg);
            loc1.scaleX = -1;
            loc1.x = loc1.width;
            loc1.y = _titleBg1.y + _titleBg1.height - 2;
            addChild(loc1);
            loc2 = GlobalClass.getBitmap(ImagesConst.RechargeSmallBg);
            loc2.x = width - loc2.width;
            loc2.y = loc1.y;
            addChild(loc2);
            loc3 = GlobalClass.getBitmap(ImagesConst.RechargeSmallBg);
            loc3.scaleX = -1;
            loc3.scaleY = -1;
            loc3.x = loc1.x;
            loc3.y = 225;
            addChild(loc3);
            (loc4 = GlobalClass.getBitmap(ImagesConst.RechargeSmallBg)).scaleY = -1;
            loc4.x = loc2.x;
            loc4.y = loc3.y;
            addChild(loc4);
            this._bodySprite = new Object /* flash.display.Sprite */();
            this._bodySprite.mouseChildren = false;
            this._bodySprite.mouseEnabled = false;
            addChildAt(this._bodySprite, (getChildIndex(_infoTxt) - 1));
            _titleTxt1.text = Language.getString(20959);
            return;
        }

        protected /* override */ createRewardList(): void
        {
            super.createRewardList();
            removeChild(_line);
            _titleBg2.y = 224;
            _titleTxt2.y = _titleBg2.y + 4;
            _titleTxt2.text = Language.getString(20960);
            return;
        }

        protected /* override */ createRewardStar(): void
        {
            return;
        }

        protected /* override */ createRwardList(): void
        {
            var loc1=0;
            var loc3=null;
            loc1 = 0;
            var loc2=11;
            while (loc1 <= loc2) 
            {
                loc3 = GlobalClass.getBitmap(ImagesConst.PackItemBg);
                loc3.x = 15 + Math.floor(loc1 % 4) * 46;
                loc3.y = 262 + Math.floor(loc1 / 4) * 38;
                addChild(loc3);
                ++loc1;
            }
            _itemList = new GTileList();
            _itemList.rowHeight = 36;
            _itemList.columnWidth = 36;
            _itemList.horizontalGap = 10;
            _itemList.verticalGap = 2;
            _itemList.columnCount = 4;
            _itemList.rowCount = 3;
            _itemList.width = 175;
            _itemList.height = 120;
            _itemList.horizontalScrollPolicy = ScrollPolicy.OFF;
            _itemList.verticalScrollPolicy = ScrollPolicy.OFF;
            _itemList.setStyle("skin", new Object /* flash.display.Bitmap */());
            _itemList.setStyle("cellRenderer", DailyItemRenderer);
            _itemList.x = 18;
            _itemList.y = 265;
            addChild(_itemList);
            _page = new PageTool([], 12);
            _pageBar = new PageSelecter();
            _pageBar.mode = PageSelecter.SingleMode;
            _pageBar.x = 65;
            _pageBar.y = 378;
            addChild(_pageBar);
            _pageBar.addEventListener(flash.events.Event.CHANGE, onCurPageChangeHandler);
            return;
        }

        public /* override */ updateData(arg1: DailyInfo): void
        {
            super.updateData(arg1);
            _titleTxt2.text = Language.getString(20960);
            _infoTxt.text = arg1.rewardDes;
            _rewardTxt.text = "";
            _infoTxt.y = _titleBg2.y - _infoTxt.textHeight - 4;
            LoaderManager.instance.load(arg1.bossImgUrl, this.onBossImgLoad, 3, arg1.type);
            return;
        }

        protected /* override */ updateRewardItem(arg1: DailyInfo): void
        {
            return;
        }

        public /* override */ dispose(): void
        {
            return;
        }

        /* internal  */onBossImgLoad(arg1: SWFInfo): void
        {
            if (arg1 && arg1.extData == _info.type) 
            {
                if (arg1.clip) 
                {
                    if (this._bossSwf && this._bossSwf.parent) 
                    {
                        this._bossSwf.parent.removeChild(this._bossSwf);
                    }
                    this._bossSwf = arg1.clip;
                    this._bossSwf.x = (width - this._bossSwf.width) / 2;
                    this._bossSwf.y = _titleBg1.y + _titleBg1.height + 4;
                    this._bossSwf.mouseChildren = false;
                    this._bossSwf.mouseEnabled = false;
                    this._bodySprite.addChild(this._bossSwf);
                }
            }
            return;
        }

        protected /* var */_bodySprite: Object /* flash.display.Sprite */;

        protected /* var */_bossSwf: Object /* flash.display.MovieClip */;
    }
